#pragma once
#include "CBaseApp.h"
#include "CFramework.h"
#include "CConstantBuffer.h"
#include "CVertexShader.h"
#include "CPixelShader.h"
#include "CVertexBuffer.h"
#include "CIndexBuffer.h"
#include "stdafx.h"

class CGameApp :
	public CBaseApp
{
public:
	CGameApp(void);
	~CGameApp() { Release(); }

	void SetFramework( CFramework* pFramework );

	BOOL Initialize();

	void Release();

	HRESULT OnCreateDevice( ID3D11Device* pD11Device, ID3D11DeviceContext* pD11DeviceContext, IDXGISwapChain* pSwapChain );
	void OnResetDevice( ID3D11Device* pD11Device );
	void OnLostDevice();
	void OnDestroyDevice();

	void OnUpdateFrame( ID3D11DeviceContext* pD11DeviceContext, IDXGISwapChain* pSwapChain, float elapsedTime );
	void OnRenderFrame( ID3D11DeviceContext* pD11DeviceContext, IDXGISwapChain* pSwapChain, ID3D11RenderTargetView* pRenderTargetView, ID3D11DepthStencilView* pDepthStencilView, float elapsedTime );
	void ProcessInput( long xDelta, long yDelta, long zDelta, BOOL* pMouseButtons, BOOL* pPressedKeys, float elapsedTime );

private:
	CFramework*				g_pFramework;
	CConstantBuffer			g_pConstantBuffer;
	CVertexShader			g_pVertexShader;
	CPixelShader			g_pPixelShader;
	CVertexBuffer			g_pVertexBuffer;
	CIndexBuffer			g_pIndexBuffer;		

	XMFLOAT4X4                g_World;
	XMFLOAT4X4                g_View;
	XMFLOAT4X4                g_Projection;
};

